digr: parser.cmo scanner.cmo interpret.cmo translate.cmo compile.cmo
	ocamlc -o digr parser.cmo scanner.cmo interpret.cmo translate.cmo compile.cmo
interpret.cmo : interpret.ml scanner.cmo parser.cmi ast.cmi
	ocamlc -c interpret.ml

translate.cmo : interpret.cmo ast.cmi cast.cmi translate.ml
	ocamlc -c translate.ml

compile.cmo : translate.cmo compile.ml
	ocamlc -c compile.ml



scanner.ml : scanner.mll
	ocamllex scanner.mll
scanner.cmo : scanner.ml parser.cmi
	ocamlc -c scanner.ml
parser.ml parser.mli : parser.mly
	ocamlyacc -v  parser.mly
parser.cmi : parser.mli ast.cmi
	ocamlc -c parser.mli
parser.cmo : parser.cmi
	ocamlc -c parser.ml
ast.cmi : ast.ml
	ocamlc -c ast.ml
cast.cmi : cast.ml
	ocamlc -c cast.ml

.PHONY : clean
clean :
	rm -f digr parser.ml parser.mli scanner.ml *.cmo *.cmi *.output *.log *.aux *.toc LRM.pdf

